function ccR_Warlock_Dark_Regeneration(specNumber)
	if specNumber == nil then specNumber = ccrPlayerSpec() end
	local UseAbility = ccRS["Warlock_" .. specNumber .. "_UseDarkRegeneration"]	
	local AbilityHP = ccRS["Warlock_" .. specNumber .. "_DarkRegenerationHP"]
	if UseAbility
	and ccrPlayerHasTalent(DARK_REGENERATION)
	and SpellIsReady(DARK_REGENERATION)
	and ccrPlayerHealth() <= AbilityHP
	then
		ccrCast(DARK_REGENERATION)
		return
	end
end

function ccR_Warlock_Demonic_Breath(specNumber)
	if specNumber == nil then specNumber = ccrPlayerSpec() end
	local UseAbility = ccRS["Warlock_" .. specNumber .. "_UseDemonicBreath"]	
	local MobCount = ccRS["Warlock_" .. specNumber .. "_DemonicBreathCount"]
	if ccrPlayerHasSpell(DEMONIC_BREATH)
	and SpellIsReady(DEMONIC_BREATH)
	and UseAbility
	and # tblPGetNearbyEnemies >= MobCount
	then
		ccrCast(DEMONIC_BREATH)
		return
	end
end

function ccR_Warlock_Mortal_Coil(specNumber)
	if specNumber == nil then specNumber = ccrPlayerSpec() end
	local UseAbility = ccRS["Warlock_" .. specNumber .. "_UseMortalCoil"]	
	local AbilityHP = ccRS["Warlock_" .. specNumber .. "_MortalCoilHP"]
	if ccrPlayerHasSpell(MORTAL_COIL)
	and SpellCanAttack(MORTAL_COIL)
	and UseAbility
	and ccrPlayerHealth() <= AbilityHP
	then
		ccrCastAttack(MORTAL_COIL)
		return
	end
end

function ccR_Warlock_Shadowfury(specNumber)
	if specNumber == nil then specNumber = ccrPlayerSpec() end
	local UseAbility = ccRS["Warlock_" .. specNumber .. "_UseShadowfury"]	
	local MobCount = ccRS["Warlock_" .. specNumber .. "_ShadowfuryCount"]
	if ccrPlayerHasSpell(SHADOWFURY)
	and SpellIsReady(SHADOWFURY)
	and UseAbility
	and not ccrPlayerIsCastingOrChanneling()
	and ccrTargetCount(10) >= MobCount
	and Target:GetDistance(Player) <= 29
	then
		ccrCast(SHADOWFURY)
		if SpellIsTargeting() == 1 then CastAtLocation(Target:GetLocation()) end
		return
	end
end